﻿using MediatR;
using RBAC.LuFang.API.Application.Command.deepprocessingCommand;
using RBAC.LuFang.Domain.Traceability;
using RBAC.LuFang.Domin.Services.TraceabilityService;

namespace RBAC.LuFang.API.Application.CommandHandlers.deepprocessingCommandHandler
{
    //更新深加工
    public class UpddeepprocessingCommandHandler:IRequestHandler<UpddeepprocessingCommand,int>
    {
        private readonly IdeepprocessingService _deepService;

        public UpddeepprocessingCommandHandler(IdeepprocessingService deepService)
        {
            _deepService = deepService;
        }

        public async Task<int> Handle(UpddeepprocessingCommand request, CancellationToken cancellationToken)
        {
            var depModel = new deepprocessing() { deepprocessingid=request.deepprocessingid, deepprocessingBan=request.deepprocessingBan, deepprocessingPeople=request.deepprocessingPeople, deepprocessingYuan=request.deepprocessingYuan, deepprocessingFu=request.deepprocessingFu, deepprocessingTian=request.deepprocessingTian, deepprocessingBao=request.deepprocessingBao, goodsId=request.goodsId };
            return await _deepService.Upddeepprocessing(depModel);
        }
    }
}
